#include "progbar.h"

void download(void (*pf)(double))
{
    int total = FILESIZE;
    int alreadly = 0;
    double rate;
    srand((unsigned int)time(NULL)^1023);
    while(alreadly < total)
    {
        Sleep(1);
        alreadly += rand()%(1024*1024);
        if(alreadly > total)
            alreadly = total;
        rate = alreadly*1.0/total*100.0;
        pf(rate);
    }
}

int main()
{
    download(progress);
    return 0;
}
